package com.hfuu.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * Author: admin
 * Date: 2018/6/3
 * time: 下午9:56
 */
public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016091400511731";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCI9/6brbW03iirbCF9h+fXeCgV4R6ydy4g0rsJyotdkU40+XON7d3uOR/TMbnHDiMYEHk9UduvcakD5yrFfzy0l8nR4v+bPol1dA9rA2BFGgskXRHRaWKo2PjKmoh5YAxANjb49qU1GBeDbGwkNVgqp0NHnfso3MVhOnyLSKP/tToD8ukOZbBPcoCARdqzBq+D4e+XfRxoWxBF6GFdGCIGbGj2YB24UJxXbau738mXLUZzybS1gDZufo3qTG+ciHfXZfoDccd585T5M1/l33BIHyRO+1s58FHThdygw59XDyEZvw4hAj2D9LV8MSYo3jC2OvhNbLN4b615KXPhA8jTAgMBAAECggEAD+8Jp4KlyMyvXoHNw5Sz29UWlLUDpS9IJnldWN4/KDtnJbJ/RtuNHdF3alI2knmKi5ofAIstS1OlndaemysaHMgrqkcGBUFZLFi8Em7qHB/Te/93uyzPVWUoTCl+BuCtjCrCamQHBA4xbhCG5A9wmkWrBgHS3gYQ0CbFpk5lBbIb4RyykgBavRn5Gs3ZzyoR7u4dIllMWLInKoI7rxOBkuwnu2Bu2CDauY3rjvocBkMvNz3mRBQr4GB57PZyHso0KiIJoGNnKHo2YnWRv7N8xmRnjZ0rMerkS0QlvdJzYdY267XuXKXEvO0b+eWhi+BLFi+gRzMwZf0pkL211xVRQQKBgQC/0103OMn4HwiPDKWONLx5Vlhk5vptVKpnWzxbvOMyo4hkuWLMDMSynfSKLmFr+ge/YJVojbnejkJqoPVqgypCctfk/I8zthbNeHpK8ZgVgVTG/Y5dpIaDo293QIoSYzY3bd23UitVBkd5O2WnlJKQwh5+9NbcVa8ibhxyKejt3wKBgQC2ynzbg9kTVqtHhR80JgztnY1vRi/9t5oZlTO9DZCDuGPLCWhtDRFS8dzjVfdqOgzmFkGLN0XxG7k9bdxJ9cOmVqWYTaIfUetSwzWVLiBA7OVLyiYL2foeCAwnhqG8n7bFnGfZz4G1F84++QSYldhrWqKR1JLmI6PQsALYuSXbjQKBgC6FfjfkR+cq75JxyLziQUtUC3/9HILjY6hJUiwVdSxUyMFUzIccGaAP+ryAXxQmwTZCoDmJFajJ64Wcn6hDQz52R7G7Jqet433VWCNQ0Ed25C6WU66WNiE6w8+yEUpAUWfD9198SBIIwdC+/PpVZ+4/hdHYYztwdFbvSWrOizUVAoGAKrwoeMHYjHbk0HHFG9IRj7QYDv3f1neIZZbGY9q6ALGpUxy991DozfWR6Ox+Ta2IunpVlJC1n2sV4dC/geMdfNQhHvx3fM8QL2dILbp8+/DmotN+FaM+oKrM/KizQ4AroQOyG/AxqP8Jzxs1Ad92m5KzE1kZhwiqEe40nCqdOTkCgYBS+21q7gi39ULPtNz5dCOGe/0rsNmb5ifwh6O4eCvGMZ7kin55dK9h3TrxIgjGVj+XnCP1ZQjbkEE+CO+3MfDQ5e9O7ac92PWPNxeP/+7VVWB1lw/Mx1zu7LCUNPctsgk08VCSPyfN0Tjk4vQudtKR/zSwi9NM0KObbj/Tr6jCFw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIgHnOn7LLILlKETd6BFRJ0GqgS2Y3mn1wMQmyh9zEyWlz5p1zrahRahbXAfCfSqshSNfqOmAQzSHRVjCqjsAw1jyqrXaPdKBmr90DIpIxmIyKXv4GGAkPyJ/6FTFY99uhpiq0qadD/uSzQsefWo0aTvP/65zi3eof7TcZ32oWpwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8089/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8089/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
